//
// Created by tang on 22-10-26.
//

#ifndef LEARNOPENGL_CUBE_HPP
#define LEARNOPENGL_CUBE_HPP

#include "app/base_app.hpp"
#include "gl/gl_utils.hpp"

class CubeApp final : public App {
public:
    using App::App;

    void OnInitialize() override;
    void OnCleanup() override;

protected:
    void RenderFrame(double delta_time, double total_time) override;
    void RenderConfigUI() override;
private:
    GL::ProgramPtr m_program_;
    GL::VertexArrayPtr m_vao_;
    GL::TexturePtr m_texture_;

    float m_x_angle_{0};
    float m_y_angle_{0};
    float m_z_angle_{0};

    bool  m_enable_auto_rotation_{false};
    float m_x_speed_{1};
    float m_y_speed_{1};
    float m_z_speed_{1};

    bool  m_draw_per_side_{true};
    int   m_side_index_{0};
};

#endif//LEARNOPENGL_CUBE_HPP
